package com.jinsi.controller.lv;

import com.jinsi.pojo.SyLvCourseCensus;
import com.jinsi.pojo.SyLvCurriculum;

import com.jinsi.service.lv.SyLvCourseCensusService;
import com.jinsi.util.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 课程统计
 * 吕昊燃
 * @Date 2022/10/12
 */

@Controller
@RequestMapping("/CourseCensus")
@Slf4j
public class SyLvCourseCensusController {
    @Autowired
    private SyLvCourseCensusService syLvCourseCensusService;

    /**
     * 全部课程统计
     * @return
     */
    @ResponseBody
    @GetMapping("/getAllSOAC")
    public R getAllSOAC(){
        log.info("全部课程统计[开始]");
        List<SyLvCourseCensus> getAllSOAC = syLvCourseCensusService.getAllSOAC();
        boolean result = true;
        log.info("全部课程统计[结束],getAllSOAC：{}", getAllSOAC);
        return R.ok(getAllSOAC);
    }

    /**
     * 课程分类统计
     * @return
     */
    @ResponseBody
    @GetMapping("/getAllSort")
    public R getAllSort(){
        log.info("课程分类统计[开始]");
        List<SyLvCurriculum> getAllSort = syLvCourseCensusService.getAllSort();
        log.info("课程分类统计[结束],getAllSort:{}", getAllSort);
        return R.ok(getAllSort);
    }
}
